package cn.com.gzheroli.core.util;


import cn.com.gzheroli.bfw.pojo.base.TSBaseUser;
import cn.com.gzheroli.bfw.pojo.base.TSDepart;
import cn.com.gzheroli.bfw.pojo.base.TSUser;
import cn.com.gzheroli.core.common.model.common.SqlContext;

public class CamelNameUtilsTest {
	public void testCamel2underscore() {
		String underscoreName = NameUtils.camel2underscore("TSUser");
		//assertThat(underscoreName, is("aaa_bbb"));
		System.out.println(underscoreName);
	}

	public void testUnderscore2camel() {
		String camelName = NameUtils.underscore2camel("APPRAOSER_A_T_YPE_dddd_");
		//assertThat(camelName,is("userName"));
		System.out.println(camelName);
	}

	public void testCapitalize() {
		String capitalName = NameUtils.capitalize("appraoserAType");
		//assertThat(capitalName,is("Student"));
		System.out.println(capitalName);
	}
	public static void main(String[]args){
		CamelNameUtilsTest t=new CamelNameUtilsTest();
		//t.testCamel2underscore();
		//t.testCapitalize();
		//t.testUnderscore2camel();
		//System.out.println(NameUtils.camel2underscore("TsUSEr"));
		//System.out.println(NameUtils.underscoreName("TSUser_"));
		//System.out.println(NameUtils.underscore2camel("ISFRONT"));
		Class c=TSBaseUser.class.getSuperclass();
		String s=c.getSimpleName();
		System.out.println(s);
		t.testUnderscore2camel();
		t.testCamel2underscore();
		String regex="(\\B[A-Z])";
		String replacement = "_$1";
		String underscoreName = "TappRa12oserA1!Type_11a!".replaceAll(regex, replacement);
		System.out.println(underscoreName);
		/*TSUser user=new TSUser();
		user.setId("1");
		user.setDEPARTID("ttrtrtr");
		user.setEmail("abc@163.com");
		user.setUserName("admin");
		user.setFax("fdfdfdgf");
		user.setMobilePhone("rerer");
		user.setPartDept("fddffdfdfd");
		user.setPartjob("gggg");
		TSBaseUser buser=new TSBaseUser();
		buser.setId("1");
		buser.setDEPARTID("ttrtrtr");
		buser.setUserName("admin");
		buser.setPartDept("fddffdfdfd");*/
		//SqlContext c=SqlUtils.buildInsertSql(user, new DefaultNameHandler());
		/*SqlContext c=SqlUtils.buildUpdateSql(user, new DefaultNameHandler());
		System.out.println(c.getSql());
		SqlContext c1=SqlUtils.buildUpdateSql(buser, new DefaultNameHandler());
		System.out.println(c1.getSql());*/
	}
}
